﻿using MediatR;
using SystemLYH.API.Application.Command.ReservoirCommand;
using SystemLYH.Domain;
using SystemLYH.Infrstructre.Interface;

namespace SystemLYH.API.Application.Handlers.ReservoirHandlers
{
    public class ReservoirBackfillHandlers : IRequestHandler<ReservoirBackfillCommand, Reservoir>
    {
        protected readonly IReservoirRepository _reservoirRepository;
        /// <summary>
        /// 库区构造函数
        /// </summary>
        /// <param name="reservoirRepository"></param>
        public ReservoirBackfillHandlers(IReservoirRepository reservoirRepository)
        {
            _reservoirRepository = reservoirRepository;
        }
        public async Task<Reservoir> Handle(ReservoirBackfillCommand request, CancellationToken cancellationToken)
        {
            return await _reservoirRepository.GetAsync(request.ReservoirId);
        }
    }
}
